// 数据状态的管理(记录/取值/修改/删除)
export default {
  namespaced: true,
  // 存数据
  state: {
    email: '',
    avatar: '',
    userName: '',
    id: '',
  },
  getters: {

  },
  // 修改数据
  mutations: {
    setEmail(state, value) {
      state.email = value;
    },
    setAvatar(state, value) {
      state.avatar = value;
    },
    setUserName(state, value) {
      state.userName = value;
    },
    setId(state, value) {
      state.id = value;
    },

  },
  // 提交修改数据的方法(异步)
  actions: {
    setEmailAsync(content, value) {
      content.commit('setEmail', value)
    },
    setAvatarAsync(content, value) {
      content.commit('setAvatar', value)
    },
    setUserNameAsync(content, value) {
      content.commit('setUserName', value)
    },
    setIdAsync(content, value) {
      content.commit('setId', value)
    }
  },
  modules: {
  }
}
